//
//  LNMainViewModel.m
//  LNDevelopExample
//
//  Created by wwww on 2018/9/7.
//  Copyright © 2018年 淘发现1iOS. All rights reserved.
//

#import "LNMainViewModel.h"
#import "LNTheme.h"
#import "LNThemeTabItem.h"

@interface LNMainViewModel()

@property (nonatomic, strong, readwrite) LNHomeViewModel *homeViewModel;
@property (nonatomic, strong, readwrite) LNNewsViewModel *newsViewModel;
@property (nonatomic, strong, readwrite) LNSerachViewModel *serachViewModel;
@property (nonatomic, strong, readwrite) LNProfileViewModel *profileViewModel;

@end

@implementation LNMainViewModel

- (void)initialize{
    [super initialize];
    
    self.homeViewModel = [[LNHomeViewModel alloc] initWithServices:self.services params:nil];
    self.newsViewModel = [[LNNewsViewModel alloc] initWithServices:self.services params:nil];
    self.serachViewModel = [[LNSerachViewModel alloc] initWithServices:self.services params:nil];
    self.profileViewModel = [[LNProfileViewModel alloc] initWithServices:self.services params:nil];
    
    
    LNAppConfigManager *app = [LNAppConfigManager getConfig];
    
    self.tab_list = [NSMutableArray array];
    //获取主题数据
    [self requestTabData];
}

#pragma mark - 网络数据请求

/**
 获取主题数据
 */
-(void)requestTabData{
    
    /// 1. 配置参数
//    CMHKeyedSubscript *subscript = [CMHKeyedSubscript subscript];
//    subscript[@"isEnglish"] = @0;
//    subscript[@"devicetype"] = @2;
//    subscript[@"version"] = @"1.0.1";
    /// 2. 配置参数模
    
    /// 1. 配置参数
    NSMutableDictionary *easyDict = [NSMutableDictionary dictionary];
    /// 2. 配置参数模型 #define MH_GET_LIVE_ROOM_LIST  @"Room/GetHotLive_v2"
    FMHttpRequest *req = [FMHttpRequest urlParametersWithMethod:HTTTP_METHOD_POST path:@"Room/GetHotLive_v2" parameters:easyDict];
    
    
//    _reqSignal = [[FMARCNetwork sharedInstance] requestNetworkData:req];
//    
//    [_reqSignal subscribeNext:^(FMHttpResonse *response) {
//        if (response.isSuccess) {
//            NSLog(@"--%@",response.reqResult);
//            
//            NSData *jsonData = [NSJSONSerialization dataWithJSONObject:response.reqResult options:NSJSONWritingPrettyPrinted error:nil];
//            
//            NSString * str = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
//            
//            self.textV.text = str;
//        }
//        
//    }];
}



@end
